<%@page import="java.util.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
	<title>
		<c:choose>
			<c:when test="${couponType eq 0}">
				<spring:message code="YYK-title-10007" />
			</c:when>
			<c:when test="${couponType eq 1}">
				<spring:message code="YYK-title-10006" />
			</c:when>
		</c:choose>
	</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=0.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name=”apple-mobile-web-app-capable” content=”yes” />
	<link rel="stylesheet" type="text/css" href="${static_server}/static/css/default.css">
	<link rel="stylesheet" href="${server}/static/css/iconfont/iconfont.css">
	<script type="text/javascript" src="${static_server}/static/js/resize.js"></script>
	<script type="text/javascript" src="${static_server}/static/js/iscroll.js"></script>
	<script type="text/javascript">
		//滚动条
	    var myScroll;
	    function loaded () {
	    	myScroll = new IScroll('#wrapper', {  
	            probeType: 2,//probeType：1对性能没有影响。在滚动事件被触发时，滚动轴是不是忙着做它的东西。probeType：2总执行滚动，除了势头，反弹过程中的事件。这类似于原生的onscroll事件。probeType：3发出的滚动事件与到的像素精度。注意，滚动被迫requestAnimationFrame（即：useTransition：假）。  
	            scrollbars: false,//有滚动条  
	            mouseWheel: true,//允许滑轮滚动  
	            fadeScrollbars: false,//滚动时显示滚动条，默认影藏，并且是淡出淡入效果  
	            bounce:true,//边界反弹  
	            interactiveScrollbars:true,//滚动条可以拖动  
	            shrinkScrollbars:'scale',// 当滚动边界之外的滚动条是由少量的收缩。'clip' or 'scale'.  
	            click: true ,// 允许点击事件  
	            keyBindings:true,//允许使用按键控制  
	          //  disableMouse: true,
	            momentum:true// 允许有惯性滑动  
	        });  
	    }
	    document.addEventListener('DOMContentLoaded',loaded, false);
	</script>
</head>
<body>
<div class="wrap" onload="loaded()">
	<header class="headerToFixed">
		<div class="closeBtn">
		   <a href="javascript:history.go(-1)"><i class="icon iconfont">&#xe60a;</i></a>
		</div>
		<div class="headerTitle">
			<c:choose>
				<c:when test="${couponType eq 0}">
					<spring:message code="YYK-20026" />
				</c:when>
				<c:when test="${couponType eq 1}">
					<spring:message code="YYK-20025" />
				</c:when>
			</c:choose>
		</div> 
	</header>
	<div class="mt1s8 contentWrap">
		<div id="wrapper" class="tops88 bottoms05">
			<div  id="scroller">
				<ul  id="J_logisticsList" class="couponsList">
					<%-- 循环现金券或者物流券 --%>
					<c:forEach items="${coupons}" var="coupon">
						<li>
						<label>
							<%-- <div class="chooseP check-box">
								<input type="checkbox" name="selectedCoupons" 
											<c:forEach items="${currentCoupons}" var="curCoupon">
												<c:if test="${coupon.couponId eq curCoupon.couponId}">checked="checked"</c:if>
											</c:forEach>
											/>
							</div> --%>
							<div class="couponsComponent 
								<c:if test="${coupon.couponStatus eq 2}">invalid</c:if>
							">
							<!-- couponsComponent加入“invalid”的失效class样式 -->
								<div class="couMoneyBox">￥<span class="moneyShow">${coupon.couponAmount}</span></div>
								<div class="couMoneytip">满<span class="keyMonkey">${coupon.couponUsePrice}</span>元可用</div>
								<div class="bottomTips">
									<div class="dateTip">
									<c:choose>
										<c:when test="${coupon.couponStatus ne 2}">
											<c:set var="currentDate"><%=System.currentTimeMillis()%></c:set>
											还有<fmt:formatNumber type="number" value="${(coupon.couponEndDate.time-currentDate)/1000/60/60/24}" maxFractionDigits="0"/>天过期
										</c:when>
										<c:otherwise>
											已过期
										</c:otherwise>
									</c:choose>
									</div>
									<div class="dateTimeBox">
										有效期至:<span class="dateTime"><fmt:formatDate value="${coupon.couponEndDate}" pattern="yyyy-MM-dd"/></span>
									</div>
								</div>
							</div>
						</label>
					</li>
					</c:forEach>
				</ul>
			</div>
		</div>
	</div>
</div>
<input type="hidden" id="path" value="${server}"/>
<input type="hidden" id="couponType" value="${couponType}"/>
</body>
</html>	